package com.ysm.smfu.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;

/**
 * Created by Administrator on 2016/11/8.
 * 在不可见情况下，将图片设为null,加快垃圾回收
 */
public class RecyclerImageView extends ImageView {


    public RecyclerImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public RecyclerImageView(Context context) {
        super(context);
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        setImageDrawable(null);
//        频繁调用gc，影响内存稳定性，导致界面不流畅
//        System.gc();
    }
}

